import request from '@/utils/request';
// 获取列表
export async function pageUser(data) {
  const res = await request.post('/UserList', data);
  if (res.status === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.msg));
}
// 删除
export async function removeUser(ids) {
  const res = await request.post('/DeleteUser', ids);

  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 添加
export async function addUser(data) {
  const res = await request.post('/CreateUser', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 修改
export const updateUser = async (data) => {
  const res = await request.post('/UpdateUser', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
};
